package jmc.core.hibernate.test;

// Generated 17/10/2011 19:03:25 by Hibernate Tools 3.2.0.b9

import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

/**
 * Home object for domain model class Tfclie00.
 * @see jmc.core.hibernate.test.Tfclie00
 * @author Hibernate Tools
 */
@Stateless
public class Tfclie00Home {

	private static final Log log = LogFactory.getLog(Tfclie00Home.class);

	@PersistenceContext
	private EntityManager entityManager;

	public void persist(Tfclie00 transientInstance) {
		log.debug("persisting Tfclie00 instance");
		try {
			entityManager.persist(transientInstance);
			log.debug("persist successful");
		} catch (RuntimeException re) {
			log.error("persist failed", re);
			throw re;
		}
	}

	public void remove(Tfclie00 persistentInstance) {
		log.debug("removing Tfclie00 instance");
		try {
			entityManager.remove(persistentInstance);
			log.debug("remove successful");
		} catch (RuntimeException re) {
			log.error("remove failed", re);
			throw re;
		}
	}

	public Tfclie00 merge(Tfclie00 detachedInstance) {
		log.debug("merging Tfclie00 instance");
		try {
			Tfclie00 result = entityManager.merge(detachedInstance);
			log.debug("merge successful");
			return result;
		} catch (RuntimeException re) {
			log.error("merge failed", re);
			throw re;
		}
	}

	public Tfclie00 findById(Tfclie00Id id) {
		log.debug("getting Tfclie00 instance with id: " + id);
		try {
			Tfclie00 instance = entityManager.find(Tfclie00.class, id);
			log.debug("get successful");
			return instance;
		} catch (RuntimeException re) {
			log.error("get failed", re);
			throw re;
		}
	}
}
